﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script src="js/index-store-db-1.0.js"></script>
    <script>

        var user1 = { id: 1, name: "wolfy", age: 20 };
        var user2 = { id: 2, name: "wolfy", age: 20 };
        //set local indexed db name
        app.db.objectStoreName = "app_test";
        //save data to indexed db
        app.db.save(user1, function () {
            console.log("Save success");
        });
        app.db.save(user2, function () {
            console.log("Save success");
        });
        //query user by id
        app.db.get(1, function (item) {
            console.log("query success", item);
        });
        //query all user
        app.db.getAll(function (items) {
            console.log("query all success", items);
        });
        
        app.db.delete(1, function () {
            console.log("delete success");
        });
    </script>
</head>
<body>

</body>
</html>